<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .card{
            width:400px;
            overflow: hidden;
            background: #fff;
            border:solid 1px #eaeaea;
            border-radius: 2px;
            margin:10px;
        }
        .card .title{
            font-size: 20px;
            font-weight: bold;
            line-height:40px;
            border-bottom: solid 2px #55f;
            margin:0;
            padding-left: 10px;
        }
        .card .content{
            padding: 10px;
        }
    </style>
</head>
<body>
    <div id="app">
        <h2>正在封装卡片(ly-card)组件</h2>
        <ly-card :title="cardData[0].title">
            <p>消息中心</p>
            <p>本站积分</p>
            <p>积分规则，规则排行榜</p>
        </ly-card>

        <ly-card :title="cardData[1].title">
            <template v-slot:content>
                <ul>
                    <li>张三</li>
                    <li>张三</li>
                    <li>张三</li>
                    <li>张三</li>
                </ul>
            </template>
            <template #more>
                <span>more...</span>
            </template>
        </ly-card>
    </div>
</body>
<script src="../libs/vue.js"></script>

<template id="card">
    <div class="card">
        <h3 class="title">
            {{title}}
            <slot name="more"></slot>
        </h3>
        <div class="content">
            <slot name="content"></slot>
        </div>
    </div>
</template>

<script>
    const card = {
        props:["title"],
        template: "#card"
    }

    new Vue({
        el:"#app",
        data() {
            return {
                cardData:[{
                    title:"个人信息&福利"
                },{
                    title:"标题2"
                }]
            }
        },
        components: {
            lyCard: card
        }
    })
</script>
</html>